# handels login in the development and test environment

class LoginController < ApplicationController
  def index
    # show login screen
  end
  
  def login
    if !params[:login][:username].nil?
      session[:username] = params[:login][:username]
      redirect_to session[:original_uri]
      #redirect_to :controller => "projects"
    else
      flash[:notice] = 'Invalid username or password.'
      redirect_to :action => "index"
    end
  end
  
  def logout
    session[:username] = nil
    flash[:notice] = 'You have successfully logged out.'
    redirect_to :action => "index"
  end
  
  
end
